package com.zhuojy.equity.mall.admin.web.controller.car;

import com.zhuojy.equity.mall.admin.common.entity.po.car.TCarEtcConsumePO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.car.TCarEtcConsumeService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xrz
 * @version 1.0
 * @description:TODO
 * @date 2024/4/11 20:41
 */
@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("carconsume")
public class TCarEtcConsumeController {
    @Autowired
    private TCarEtcConsumeService tCarEtcConsumeService;

    /**
     * 查询信息
     * @param tCarMaintainPO
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping("findconsumerPagination")
    private ResultEntity findconsumerPagination(@RequestBody TCarEtcConsumePO tCarMaintainPO, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum) {
        return tCarEtcConsumeService.findconsumerPagination(tCarMaintainPO, pageSize, pageNum);
    }

    /**
     * 添加信息
     * @param tCarEtcConsumePO
     * @return
     */
    @RequestMapping("addconsume")
    private ResultEntity addconsume(@RequestBody TCarEtcConsumePO tCarEtcConsumePO){
        return tCarEtcConsumeService.addconsume(tCarEtcConsumePO);
    }

    /**
     * 修改信息
     * @param tCarEtcConsumePO
     * @return
     */
    @RequestMapping("upconsume")
    private ResultEntity upconsume(@RequestBody TCarEtcConsumePO tCarEtcConsumePO){
        return tCarEtcConsumeService.upconsume(tCarEtcConsumePO);
    }

    /**
     * 回显信息
     * @param id
     * @return
     */
    @RequestMapping("echoconsume")
    private ResultEntity echoconsume(@RequestParam("id") Integer id){
        return tCarEtcConsumeService.echoconsume(id);
    }
    @RequestMapping("delconsume")
    private ResultEntity delconsume(@RequestParam("id") Integer id){
        return tCarEtcConsumeService.delconsume(id);
    }
}
